package com.lyf.config;

import com.alibaba.cloud.sentinel.SentinelProperties;
import com.alibaba.cloud.sentinel.datasource.config.NacosDataSourceProperties;
import com.alibaba.cloud.sentinel.endpoint.SentinelEndpoint;
import org.springframework.boot.env.OriginTrackedMapPropertySource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @AUTHOR LYF
 * @DATE 2022/5/30
 * @VERSION 1.0
 * @DESC
 */
@Configuration
public class CloudConfig {

//    @Bean
//    SentinelEndpoint sentinelEndpoint(){
//        SentinelProperties sentinelProperties = new SentinelProperties();
//        SentinelProperties.Transport transport = new SentinelProperties.Transport();
//        transport.setDashboard("localhost:8080");
//        transport.setPort("8719");
//        sentinelProperties.setTransport(transport);
//        SentinelEndpoint endpoint =new SentinelEndpoint(sentinelProperties);
//        return endpoint;
//    }

    @Bean
    SentinelProperties.Transport transport(){
        SentinelProperties.Transport transport = new SentinelProperties.Transport();
        transport.setDashboard("localhost:8080");
        transport.setPort("8719");
        NacosDataSourceProperties nacosDataSourceProperties = new NacosDataSourceProperties();
        //nacosDataSourceProperties.set
        // OriginTrackedMapPropertySource originTrackedMapPropertySource = new OriginTrackedMapPropertySource();
        return transport;
    }

}
